<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="../img/com/logo.png">
    <title>P2P小贷</title>
    <link rel="stylesheet" href="../asserts/css/normalize.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/index.css">
</head>
<body class="hold-transition skin-blue-light sidebar-mini" onload="onload();">
<div class="wrapper">

    <div id="header">

    </div>

    <!-- Left side column. contains the logo and sidebar -->
    <div id="sidebar">

    </div>

    <!-- Content Wrapper. Contains pagefenye content -->
    <div id="content" class="content-wrapper clearfix">
        <!-- Content Header (Page header) -->


    </div>
    <!-- /.content-wrapper -->

    <div id="footer">

    </div>

    <!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
    <div class="control-sidebar-bg"></div>

</div>
<!-- ./wrapper -->

<!-- jQuery 2.2.3 -->
<script src="../asserts/js/jquery-2.2.4.js"></script>
<!-- Bootstrap 3.3.6 -->
<!--<script src="../resources/bootstrap/js/bootstrap.min.js"></script>-->

<!--左侧菜单-->
<!--<script src="../resources/dist/js/common/global.js"></script>-->
<!--<script src="../resources/dist/js/menu/menuTemplate.js"></script>-->
<!--<script src="../resources/dist/js/menu/menu.js"></script>-->
</body>
<script>

    //加载页面布局的header,sidebar,footer的内容
    $("#header").load("inc/header.html");
    $("#sidebar").load("inc/sidebar.html");
    $("#footer").load("inc/footer.html");

    /*
    *加载变换内容，主要url参数为dom对象，并且该dom中的url放在href中，
    *调用方式如：<span onclick="javascript:load(this);" href="/backstage/website/test.html">测试</span>
    *注意：1.该dom对象最好不要用a标签，因为点击a标签会进入href指定的页面
    *      2.要加载的内容要用 id="content" 标注，因为load中指明了加载页面中指定的id为content下的内容
    *    3.对应页面的JavaScript写在content下
    */
    function load(url, data){
        //alert($(url).attr("href"));
        $.ajaxSetup({cache: false });
        $("#content").load($(url).attr("href")+ " #content ", data, function(result){
            //alert(result);
            //将被加载页的JavaScript加载到本页执行
            $result = $(result);
            $result.find("script").appendTo('#content');
        });

    }
</script>
</html>